package com.vivien.example.springbootdemo.controller;

import com.vivien.example.springbootdemo.pojo.Employee;
import com.vivien.example.springbootdemo.service.EmployeeService;
import com.vivien.example.springbootdemo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmployeeController {
    @Autowired
    private EmployeeService service;

    @PostMapping("employee")
    public Result addOne(@RequestBody Employee employee){
        int i=service.addEmployee(employee);
        return new Result(200,"成功",i);
    }
}
